Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zendesk e2e enhancement #5

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

Vipinofficial11
Copy link

No description provided.


@TS-ZD-RNTM-MACRO-02 @BQ_SINK @BQ_SINK_CLEANUP @FILE_PATH
@TS-ZD-RNTM-MACRO-02 @BQ_SINK @BQ_SINK_CLEANUP @TEST_DATA @DELETE_TEST_DATA
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hook's value is @CREATE_GROUP I guess you have used a wrong one here.

@@ -17,7 +17,7 @@
@Regression
Feature: Zendesk Source - Run time scenarios

@TS-ZD-RNTM-MACRO-01 @BQ_SINK @BQ_SINK_CLEANUP @FILE_PATH
@TS-ZD-RNTM-MACRO-01 @BQ_SINK @BQ_SINK_CLEANUP @TEST_DATA @DELETE_TEST_DATA
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hook's value is @CREATE_GROUP, update the value here.


/**
* Represents Test Setup and Clean up hooks.
*/
public class TestSetupHooks {
private static boolean firstFileSinkTestFlag = true;
public static String testdata_Group = "";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use camel case in the naming instead of underscore. (testdata_Group -> groupResponse)


/**
* Represents Test Setup and Clean up hooks.
*/
public class TestSetupHooks {
private static boolean firstFileSinkTestFlag = true;
public static String testdata_Group = "";
public static String cred = "";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change cred -> credentials

@After(order = 2, value = "@DELETE_GROUP")
public void deleteGroup() {
DataValidationHelper.deleteGroup(cred);
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the indentation

* Zendesk utility - enhancements.
*/
public class DataValidationHelper {
private static String baseURI = "https://cloudsufi.zendesk.com/api/v2";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can put this base URI in the plugin parameter properties file.

.header("authorization", cred)
.delete(baseURI + "/groups/" + ZendeskPropertiesPageActions.uniqueId + ".json");
}
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix Indentation

BigInteger uniqueId = expectedOutputAsJson.get("id").getAsBigInteger();
JsonObject expectedOutputAsJson = gson.fromJson(TestSetupHooks.testdata_Group, JsonObject.class);
JsonObject group = (JsonObject) expectedOutputAsJson.get("group");
System.out.println(group);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove System.out.println()

}
}


public static void verifyIfRecordCreatedInSinkForMultipleObjectsAreCorrect(String expectedOutputFile)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert all the spacing related changes in this method.

@@ -149,13 +143,17 @@ static boolean compareValueOfBothResponses(String zendeskResponse, String bigQue
Map<String, Object> bigQueryResponseInMap = gson.fromJson(bigQueryResponse, type);
MapDifference<String, Object> mapDifference = Maps.difference(zendeskResponseInmap, bigQueryResponseInMap);
logger.info("Assertion :" + mapDifference);

return mapDifference.areEqual();
}

public static void getBigQueryTableData(String dataset, String table, BigInteger uniqueId)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have written the altered query here specifically for groups but this method getBigQueryTableData is common and can be used to fetch data from any big query table, this will throw an error if the table consist data of another object. (For ex: Tags may not have field like updatedAt and createdAt).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The objects we are using : Groups and Organisations , both have the same fields.

@@ -41,7 +41,7 @@
public class ZendeskBatchSourceConfigTest {

private static final String MOCK_STAGE = "mockStage";
private static MockPipelineConfigurer pipelineConfigurer = null;
private static MockPipelineConfigurer pipelineConfigure = null;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert this change, not related to Automation.

@@ -352,8 +352,8 @@ public void testConfigurePipelineWithInvalidBasicParam() {
"");
try {
ZendeskBatchSource zendeskBatchSource = new ZendeskBatchSource(config);
pipelineConfigurer = new MockPipelineConfigurer(null);
zendeskBatchSource.configurePipeline(pipelineConfigurer);
pipelineConfigure = new MockPipelineConfigurer(null);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these changes.

@@ -414,8 +414,8 @@ public void testConfigurePipelineMultiSourceWithInvalidBasicParam() {
"");
try {
ZendeskBatchMultiSource zendeskBatchMultiSource = new ZendeskBatchMultiSource(config);
pipelineConfigurer = new MockPipelineConfigurer(null);
zendeskBatchMultiSource.configurePipeline(pipelineConfigurer);
pipelineConfigure = new MockPipelineConfigurer(null);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert these changes.

@satyamsufi satyamsufi force-pushed the E2E_Test_Enhancement branch from 230dd4e to 3833653 Compare March 2, 2023 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants